package com.example.spider.provider.m3u8.task;

import com.example.spider.provider.m3u8.dto.M3u8Key;
import com.example.spider.task.AbstractSpiderTask;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.concurrent.CountDownLatch;

/**
 * 解析m3u8元数据，可能额外下载 m3u8、key
 *
 * @author lym
 */
@Getter
@Setter
@Accessors(chain = true)
public class M3u8KeyTask extends AbstractSpiderTask<byte[]> {

    private M3u8Key key;

    private CountDownLatch latch;

    @Override
    public byte[] onNoRetryEx(Exception e) {
        // 通知 m3u8 任务 key 完成
        latch.countDown();
        return super.onNoRetryEx(e);
    }


    @Override
    public boolean supportCluster() {
        return false;
    }
}
